package cn.wolfcode.web.controller;

import cn.wolfcode.service.IBusinessService;
import cn.wolfcode.service.ISystemDictionaryItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;


@RequestMapping("/frontend")
@Controller
public class IndexController {
    @Autowired
    private ISystemDictionaryItemService systemDictionaryItemService;
    @Autowired
    private IBusinessService businessService;

    @RequestMapping("/index")
    public String  index(Model model){
//        查询业务大类
        model.addAttribute("sdi",systemDictionaryItemService.queryBySn("business"));
//       查询门店信息
        model.addAttribute("mainStore",businessService.get(3L));

//        查询所有门店
        model.addAttribute("business",businessService.listAll());
        return "/frontend/index";
    }
}
